﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Hopscotch.Common.Contracts.EnqService;
using Hopscotch.Domain.Enquiry;
using Hopscotch.Domain.Finance;
using Hopscotch.Presentation.Controls.DataProviders;

namespace Hopscotch.Presentation.TradeModule.Services
{
    public class InstrumentDataProvider : IInstrumentDataProvider
    {
        private readonly IInstrumentEnqService instrumentHubClient;

        public InstrumentDataProvider(IInstrumentEnqService instrumentHubClient)
        {
            this.instrumentHubClient = instrumentHubClient;
        }

        public Task<ICollection<Instrument>> SearchAsync(string search)
        {            
            return instrumentHubClient.SearchInstrumentAsync(search);
        }

        public Task<Instrument> GetInstrument(int id)
        {            
            return instrumentHubClient.GetInstrument(id);            
        }
    }
}
